#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(s) s.begin(), s.end()
const int MOD = 998244353;

void solve() {
	int n; cin >> n;
	const int V = 1e5;
	vector<int> cnt(V + 1);
	for (int i = 1; i <= n; i++) {
		int x; cin >> x;
		cnt[x]++;
	}
	int ans = 0, pre = 0;
	for (int i = 1; i <= V; i++) {
		int d = min(pre, cnt[i]);
		ans += d;
		pre += cnt[i] - d;
	}
	cout << n - ans << '\n';
	return;
}

int main() {
	auto start = chrono::steady_clock::now();
	freopen("duel.in", "r", stdin);
	freopen("duel.out", "w", stdout);
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	solve();
	auto end = chrono::steady_clock::now();
	cerr << "time: " << chrono::duration<double, milli>(end - start).count() << "ms" << endl;
}